<!--<?php
include_once PrintEot('left');
if (empty($type)) {print <<<EOT
-->
<div class="nav3 mb10">
    <ul id="basictype" class="cc">
		<li class="current"><a href="$_basename" hidefocus="true">相册类型管理</a></li>
    </ul>
</div>
<div class="admin_info mb10" id="legend">
	<h3 class="h1">功能说明</h3>
	<div class="legend">
		<div class="note">
		添加楼盘的相册分类<span>系统默认相册不允许修改</span><br />
		</div>
	</div>
</div>
<h2 class="h1"><span class="mr10 fl">相册分类维护</span><span class="fl linka"><a href="#" onclick="addType(0,this);return false;" class="btn_add"><i>添加一级分类</i></a></span></h2>
<form action="$_basename" method="post">
<div class="admin_table mb10">
	<table width="100%" cellspacing="0" cellpadding="0" class="mb10">
		<tbody>
			<tr class="tr2">
				<td>启用</td>
				<td>[顺序]分类名称</td>
				<td>操作</td>
			</tr>
<!--
EOT;
foreach ($topTypes as $key=>$top) {
$checked = $top['ifuse'] ? 'checked="checked"' : '';
$ifReadonly = $top['ifsystem'] ? 'disabled="true" readonly="readonly" ' : '';
print <<<EOT
-->
			<tr class="tr1 vt">
				<td class="td2"><input type="checkbox" name="imagetype[$key][ifuse]" $checked /></td>
				<td class="td2">
					<span class="mr10"><input name="imagetype[$key][position]" value="$top[position]" class="input input_wd" type="text"></span>
					<span class="mr10"><input $ifReadonly name="imagetype[$key][name]" value="$top[name]" class="input input_wa" type="text"></span>
					<span class="mr10"><a href="#" onclick="addType($key,this);return false;">+添加二级分类</a></span>
					<input name="imagetype[$key][id]" value="$top[id]" class="input input_wa" type="hidden">
				</td>
<!--
EOT;
if($top['ifsystem']){
print <<<EOT
-->
				<td class="td2">-</td>
<!--
EOT;
}else{print <<<EOT
-->
				<td class="td2"><a href="javascript:;" onclick="delType($key,this);" class="fourm-two">[删除]</a></td>
<!--
EOT;
}print <<<EOT
-->	
			</tr>
<!--
EOT;
if($secendTypes[$key]){
foreach ($secendTypes[$key] as $k=>$secend) {
$checked = $secend['ifuse'] ? 'checked="checked"' : '';
$ifReadonly = $secend['ifsystem'] ? 'disabled="true" readonly="readonly" ' : '';
print <<<EOT
-->
			<tr class="tr1 vt">
				<td class="td2"><input type="checkbox" name="imagetype[$k][ifuse]" $checked /></td>
				<td class="td2">
				<span style="padding-left:30px">
					<span class="mr10"><input name="imagetype[$k][position]" value="$secend[position]" class="input input_wd" type="text"></span>
					<span class="mr10"><input $ifReadonly name="imagetype[$k][name]" value="$secend[name]" class="input input_wa" type="text"></span>
					<input name="imagetype[$k][id]" value="$secend[id]" class="input input_wa" type="hidden">
				</span>
				</td>
<!--
EOT;
if($secend['ifsystem']){
print <<<EOT
-->
				<td class="td2">-</td>
<!--
EOT;
}else{print <<<EOT
-->
				<td class="td2"><a href="javascript:;" onclick="delType($k,this);" class="fourm-two">[删除]</a></td>
<!--
EOT;
}print <<<EOT
-->	
			</tr>
<!--
EOT;
}}print <<<EOT
-->	
<!--
EOT;
}print <<<EOT
-->			
		</tbody>
	</table>
	<input type="hidden" name="type" value="updatetypes">
	<div class="mb10 tac">
		<span class="btn"><span><button type="submit" onfocus="blur();">提交</button></span></span>
	</div>
</div>
</form>
<script src="js/pw_ajax.js" language="JavaScript"></script>
<script src="js/global.js" language="JavaScript"></script>
<script language="javascript">
function addType(sub,o){
	var url = "$ajax_basename";
	read.obj = o;
	ajax.send(url,'type=addtype&sub='+sub,ajax.get);
}
function delType(id,o){
	if (!confirm("确定要删除此分类吗？")){
		return false;
	}
	read.obj = o;
	var url = "$ajax_basename";
	ajax.send(url,'type=deltype&id='+id,ajax.get);
}
</script>

<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->